/**
 * 
 */
package tau.adx.common.messages.auction;

import lombok.Data;
import lombok.EqualsAndHashCode;
import tau.adx.common.publishers.AdxPublisher;
import tau.adx.common.users.AdxUser;
import tau.adx.simulator.AdX;

/**
 * Indicates that an auction in the system was canceled due to some reason.
 * Contains data about: <li>{@link AdxUser user} the auction was performed for</li>
 * <li>{@link AdxPublisher publisher} the auction was performed for</li><li>
 * <b>Reserve Price</b> sent by the {@link AdxPublisher publisher}</li>
 * 
 * @author greenwald
 * 
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class AuctionCanceled extends AuctionMessage {

	/**
	 * @param user
	 *            {@link AdxUser} auction was performed for.
	 * @param publisher
	 *            {@link AdxPublisher} auction was performed for.
	 * @param reservePrice
	 *            {@link AdxPublisher Publisher}'s reserve price.
	 * @param cancellationReason
	 *            {@link CancellationReason Reason} for the cancellation of the
	 *            {@link AdX#runAuction(AdxUser, AdxPublisher, double) auction}.
	 */
	public AuctionCanceled(AdxUser user, AdxPublisher publisher,
			double reservePrice, CancellationReason cancellationReason) {
		super(user, publisher, reservePrice);
		this.cancellationReason = cancellationReason;
	}

	/**
	 * Reason for the cancellation of the
	 * {@link AdX#runAuction(AdxUser, AdxPublisher, double) auction}.
	 */
	private CancellationReason cancellationReason;

}
